<extend name="Public/base"/>

<block name="body">
	

    <div class="main-title">
        <h2>广告列表 </h2>
    </div>
    <if condition="IS_ROOT">
        <div class="cf">
            <div class="span8">
                <a class="btn btn-primary" href="{:U('Poster/listsAdd?spaceid='.$spaceid)}" {$modal}>新 增</a>
                <a class="btn btn-danger ajax-post" href="{:U('listsDel?spaceid='.$spaceid)}" target-form="ids">删 除</a>
            </Ddiv>
            <div class="span4 toolbar-text-right search-form">
                <div class="input-append"></div>
            </div>
        </div>
    </if>

    <div class="data-table table-striped">
        <form class="ids">
            <table>
                <thead>
                    <tr>
                    <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
                    <th class="">编号</th>
                    <th class="">广告名称</th>
                    <th class="">链接地址</th>
                    <th class="">广告图片</th>
                    <th class="">状态</th>
                    <th class="">操作</th>
                    </tr>
                </thead>
                <tbody>
                <notempty name="_list">
                    <volist name="_list" id="vo">
                    <tr>
                        <td><input class="ids" type="checkbox" name="ids[]" value="{$vo.id}" /></td>
                        <td>{$vo.id} </td>
                        <td><a data-id="{$vo.id}" href="{:U('Poster/listsEdit?id='.$vo['id'])}">{$vo.title}</a></td>
                        <td>{$vo.url}</td>
                        <td><img src="__ROOT__{$vo.icon|get_cover=###,'path'}" style="width:300px; height:80px;" /></td>
                        <td>{$vo['status']  ?  '启用'  :  '禁用'}</td>
                        <td>
                             <a href="{:U('Poster/cateEdit?id='.$vo['id'].'&spaceid='.$spaceid)}" {$modal} class="da-tooltip-w" title="编辑">编辑</a>
                        </td>
                    </tr>
                    </volist>
                    <else/>
                    <td colspan="11" class="text-center"> aOh! 暂时还没有内容! </td>
                    </notempty>
                </tbody>
            </table>
        </form>
        <!-- 分页 -->
        <div class="page">
             {$_page}
        </div>
    </div>


</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
    <script type="text/javascript">
    $(function(){
    	$("#search").click(function(){
    		var url = $(this).attr('url');
    		var status = $('select[name=status]').val();
    		var search = $('input[name=search]').val();
    		if(status != ''){
    			url += '/status/' + status;
    		}
    		if(search != ''){
    			url += '/search/' + search;
    		}
    		window.location.href = url;
    	});
		highlight_subnav('{:U('Poster/index')}');
})
</script>
</block>
